<ui:composition template="/WEB-INF/templates/main-template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

	<ui:define name="sidebar">
		<ui:include src="/WEB-INF/templates/public-sidebar.xhtml" />
	</ui:define>
	<ui:define name="content">
		<h:form id="moduleForm">
			<p:focus for="holidayDate"/>
			<p:growl />
			<h:outputText value="Holiday Calendar" styleClass="outputTextTitle" />
			<h:panelGrid columns="3">
				<h:outputLabel value="#{msg['holidaydate.label']}" />
				<h:outputLabel value=" : " />

				<p:calendar id="holidayDate" value="#{holidayCalendarBean.holidayCalendar.holidayDate}" showButtonPanel="true" navigator="true" />

				<h:outputLabel value="#{msg['holidayoccassion.label']} " />
				<h:outputLabel value=" : " />
				<p:inputText id="displayOrder" value="#{holidayCalendarBean.holidayCalendar.nameOfTheOccassion}" />
				<h:outputLabel value="#{msg['holidayday.label']} " />
				<h:outputLabel value=" : " />
				<p:inputText value="#{holidayCalendarBean.holidayCalendar.occassionDay}" />
				<h:inputHidden />
				<h:inputHidden />
				<p:commandButton value="Save Holiday"
					actionListener="#{holidayCalendarBean.saveHoliday}" ajax="false" />
			</h:panelGrid>
			
			
			<h:outputLabel value="Existing Holidays" styleClass="outputTextSubTitle"/>
			
			
            <p:dataTable value="#{holidayCalendarBean.holidaysList}" var="holidayCalendar" binding="#{holidayCalendarBean.assignedHolidays}">
             <p:column>
             <f:facet name="header">
						<h:outputText value="Holiday Date" />
					</f:facet>
              <h:outputText value="#{holidayCalendar.holidayDate}">
               <f:convertDateTime pattern="dd-MMM-yyyy" timeZone="#{holidayCalendarBean.defaultTimeZone}"/>
              </h:outputText>
             </p:column>
             <p:column>
             <f:facet name="header">
						<h:outputText value="Name Of The Occassion" />
					</f:facet>
              <h:outputText value="#{holidayCalendar.nameOfTheOccassion}" />
             </p:column>
             <p:column>
             <f:facet name="header">
						<h:outputText value="Occassion Day" />
					</f:facet>
              <h:outputText value="#{holidayCalendar.occassionDay}" />
             </p:column>
            
            </p:dataTable>
		</h:form>
	</ui:define>
</ui:composition>